package com.slz3.business.module.drawManagement.draGoods.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.drawManagement.draGoods.domain.DraGoods;
import com.slz3.business.module.drawManagement.draGoods.domain.DraGoodsCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class DraGoodsResAtomic {

    static Mono<ServerResponse> add_$DraGoodsUpdateLock(ServerRequest req, DraGoods draGoods) {
        return DraGoodsResSafeValid.add(req, draGoods) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.add(req, draGoods);
    }

    public static Mono<ServerResponse> delete_$DraGoodsUpdateLock(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        return DraGoodsResSafeValid.delete(req, draGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$DraGoodsUpdateLock(ServerRequest req, DraGoods draGoods) {
        return DraGoodsResSafeValid.modify(req, draGoods) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.modify(req, draGoods);
    }

    static Mono<ServerResponse> info_$DraGoodsUpdateLock(ServerRequest req) {
        return DraGoodsResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$DraGoodsUpdateLock(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        return DraGoodsResSafeValid.auditSubmit(req, draGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$DraGoodsUpdateLock(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        return DraGoodsResSafeValid.audit(req, draGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$DraGoodsUpdateLock(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        return DraGoodsResSafeValid.auditReject(req, draGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$DraGoodsUpdateLock(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        return DraGoodsResSafeValid.usingEnable(req, draGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$DraGoodsUpdateLock(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        return DraGoodsResSafeValid.usingDisable(req, draGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                DraGoodsResExecutor.usingDisable(req);
    }
}
